package com.foo.designpattern.observer;

import junit.framework.TestCase;

/**
 * com.foo.designpattern.observer
 * Created with IntelliJ IDEA.
 * Created by jiang on 2016-04-22 19:46.
 *
 * @Description
 */
public class ObserverTestCase extends TestCase {
    public void testObserver() {
        System.out.println("= = = = ↓↓↓观察者模式，测试开始↓↓↓ = = = =");

        WeatherStation weatherStation = new WeatherStation();
        TravelAgency travelAgency = new TravelAgency();
        Person mrLi = new Person(travelAgency, weatherStation);
        weatherStation.doForecast("22号", "晴", 21, 18);
        travelAgency.giveMess("22日", "南京博物院一日游");
        weatherStation.doForecast("23号", "雷阵雨", 18, 13);
        travelAgency.giveMess("23日", "卧床瘫痪");

        System.out.println("= = = = ↑↑↑观察者模式，测试结束↑↑↑ = = = =");
    }
}
